﻿
Namespace LightSwitchApplication

    Public Class DestinationManagement

        Private Sub DestinationManagement_InitializeDataWorkspace(saveChangesTo As System.Collections.Generic.List(Of Microsoft.LightSwitch.IDataService))
            ' Write your code here.
            If Me.Id.HasValue Then
                Me.DestinationProperty = Me.Destination
            Else
                Me.DestinationProperty = New Destination()
            End If

        End Sub

        Private Sub DestinationManagement_Saved()
            ' Write your code here.
            Me.Close(False)
            Application.Current.ShowDefaultScreen(Me.DestinationProperty)
        End Sub

        Private Sub OrderHeadersAddAndEditNew_CanExecute(ByRef result As Boolean)
            ' Write your code here.

        End Sub

        Private Sub OrderHeadersAddAndEditNew_Execute()
            ' Write your code here.
            Me.Application.ShowOrderManagement(Nothing)
        End Sub

        Private Sub OrderHeadersEditSelected_CanExecute(ByRef result As Boolean)
            ' Write your code here.

        End Sub

        Private Sub OrderHeadersEditSelected_Execute()
            ' Write your code here.
            Me.Application.ShowOrderManagement(Me.OrderHeaders.SelectedItem.Id)
        End Sub

        Private Sub NewDestination_Execute()
            ' Write your code here.
            Me.DestinationProperty = New Destination()
        End Sub
    End Class

End Namespace